<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/10/23
 * Time: 2:20 PM
 */

namespace app\model;


use think\model\concern\SoftDelete;

class ActivityOrderRefund extends Base
{
    protected $pk = 'id';
    // 此处表名请务必设置为public
    public $table = 'activity_order_refund';
    // 软删除
    use SoftDelete;
    protected $deleteTime = 'delete_at';
    protected $defaultSoftDelete = 0;

    /**
     * @purpose 关联用户模型
     * @return \think\model\relation\HasOne
     */
    public function member ()
    {
        return $this->hasOne('Member', 'uid', 'uid');
    }

    /**
     * @purpose 关联管理员模型
     * @return \think\model\relation\HasOne
     */
    public function administrator () {
        return $this->hasOne('Administrator', 'uid', 'administrator_id');
    }

    /**
     * @purpose 关联活动订单模型
     * @return \think\model\relation\HasOne
     */
    public function activityOrder () {
        return $this->hasOne('ActivityOrder', 'id', 'order_id');
    }
    /**
     * @purpose 绑定活动模型
     * @return \think\model\relation\HasOne
     */
    public function activity () {
        return $this->hasOne('Activity', 'id', 'activity_id');
    }
}